//
// Created by 86138 on 2025/6/17.
//

#ifndef QINGDAO_UNIVERSITY_SSTABLE_H
#define QINGDAO_UNIVERSITY_SSTABLE_H
#include "../01-intro/c1-1.h"
namespace sweetcookie9_1 {

    typedef long KeyType;
    #define key number
    struct ElemType {
        long number;
        char name[9];
        int politics;
        int chinese;
        int english;
        int math;
        int physics;
        int chemistry;
        int biology;
        int total;
    };

    struct SSTable {
        ElemType *elem;
        int length;
    };

    void CreateFromFile(SSTable &ST, char *filename);

    void InputFromFile(FILE* f, ElemType &c);

    void Traverse(SSTable ST, void(*Visit)(ElemType));

    void Visit(ElemType c);

    int Search(SSTable ST, KeyType key);
}
#endif //QINGDAO_UNIVERSITY_SSTABLE_H
